using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;
using Box2D.XNA;
namespace TurbaconPhone
{
    public class KineticGameObject : GameObject
    {
        public Body Body { get; private set; }
        public override Vector2 Pos
        {
            get
            {
                return Body.Position;
            }
            set
            {
                _pos = value;
            }
        }
        private Vector2 _pos;
        public override Vector2 Vel
        {
            get
            {
                return Body.GetLinearVelocity();
            }
            set
            {
                Body.SetLinearVelocity(value);
            }
        }
        public override float AngVel
        {
            get
            {
                return Body.GetAngularVelocity();
            }
            set
            {
                Body.SetAngularVelocity(value);
            }
        }
        public override float Angle
        {
            get
            {
                return Body.GetAngle();
            }
            set
            {
                _angle = value;
            }
        }
        private float _angle;
        public KineticGameObject(Texture2D texture, Vector2 pos)
            :base(texture)
        {
            _pos = pos;
            BodyDef def = new BodyDef();
            def.position = pos;
            def.type = BodyType.Dynamic;
            Body=Physics.World.CreateBody(def);
        }
    }
}
